#ifndef DBMANAGER_H
#define DBMANAGER_H

#include <QSqlDatabase>
#include <QObject>

class DBManager : public QObject {
    Q_OBJECT
public:
    static DBManager* instance(); // 通过instance静态方法获取单例实例
    QSqlDatabase getDatabase();     // 获取数据库连接

private:
    DBManager(QObject* parent = nullptr); // 构造函数私有化
    ~DBManager();

    QSqlDatabase db; // 数据库连接对象
};

#endif
